function Base.:(-)(x::Clock, y::Clock)
    nanosecs = nanoseconds(x) - nanoseconds(y)
    return TimeSpan(nanosecs, 0)
end

function Base.:(-)(x::T, y::T) where T<:AbstractClock
    nanosecs = nanoseconds(x) - nanoseconds(y)
    return TimeSpan(nanosecs, 0)
end

function Base.:(-)(x::T, y::Clock) where T<:AbstractClock
    return Clock(x) - y
end
function Base.:(-)(x::Clock, y::T) where T<:AbstractClock
    return x - Clock(y)
end
function Base.:(-)(x::LocalTime, y::UniversalTime)
    return x - LocalTime(y)
end
function Base.:(-)(x::UniversalTime, y::LocalTime)
    return LocalTime(x) - y
end

for P in [:Nanosecond, :Microsecond, :Millisecond,
          :Second, :Minute, :Hour, :Day, :Week,
    	  :Nanoseconds, :Microseconds, :Milliseconds,
          :Seconds, :Minutes, :QuarterHours, :Hours, :Days, :Weeks]
    @eval begin
        Base.:(+)(x::T, p::$P) where T<:SimpleClock = (T)(nanoseconds(x) + nanoseconds(p))
        Base.:(+)(p::$P, x::T) where T<:SimpleClock = (T)(nanoseconds(x) + nanoseconds(p))
        Base.:(-)(x::T, p::$P) where T<:SimpleClock = (T)(nanoseconds(x) - nanoseconds(p))
        Base.:(-)(p::$P, x::T) where T<:SimpleClock = throw(ErrorException("period - clock is invalid, use clock - period"))
    end
end

for P in [:Month, :Year,
          :Months, :Quarters, :Years, :Decades, :Centuries]
    @eval begin
        function Base.:(+)(x::T, p::$P) where T<:SimpleClock
            clock = Clock(x)
            yr,mo,dy = yearmonthday(clock)
            clocktime = clock - Clock(yr, mo, dy)
            mo -= 1
            mo += months(p)
            dyr, mo = fldmod(mo, MONTHS_PER_YEAR)
            mo += copysign(1, mo)
            yr += dyr
            clock = Clock(yr, mo, dy) + clocktime
            return (T)(clock)
        end
        Base.:(+)(p::$P, x::T) where T<:SimpleClock = x + p
        function Base.:(-)(x::T, p::$P) where T<:SimpleClock
            clock = Clock(x)
            yr,mo,dy = yearmonthday(clock)
            clocktime = clock - Clock(yr, mo, dy)
            mo -= 1
            mo -= months(p)
            dyr, mo = fldmod(mo, MONTHS_PER_YEAR)
            mo += copysign(1, mo)
            yr += dyr
            clock = Clock(yr, mo, dy) + clocktime
            return (T)(clock)
        end
        Base.:(-)(p::$P, x::T) where T<:SimpleClock = throw(ErrorException("span - clock is invaild, use clock - span"))
    end
end
